#if defined gametext_inc
#endinput
#endif
#define gametext_inc

/*x---------------------------------Important-------------------------------------x*/
//**INCLUDES**//
#include <a_samp>
/*x---------------------------------Defining-------------------------------------x*/
//**VARIABLES**//
static Text:tdtext = Text:-1;
static remtimer;
//**FORWARDS**//
forward GameTextRemoval();
//**NATIVES**//
/*
native DisplayTextForPlayer(playerid, text[], time, font);
native DisplayTextForAll(text[], time, font);
*/
/*x---------------------------------CallBacks-------------------------------------x*/
stock DisplayTextForPlayer(playerid, /*const*/ text[], time, font, style) // Max Fonts: 3(0-3)   <->   Max Styles: 4(1-4)
{
	new Float:TEXTX,Float:TEXTY;
	if(tdtext != Text:-1)
	{
		GameTextRemoval();
		KillTimer(remtimer);
	}
	if (style == 1) TEXTX = 208, TEXTY = 101;
	else if (style == 2) TEXTX = 212, TEXTY = 152;
	else if (style == 3) TEXTX = 445, TEXTY = 378;
	else if (style == 4) TEXTX = 1, TEXTY = 376;
	else TEXTX = 246, TEXTY = 142;
	tdtext = TextDrawCreate(TEXTX,TEXTY,text);
	TextDrawAlignment(tdtext,0);
	TextDrawBackgroundColor(tdtext,0x000000ff);
	TextDrawFont(tdtext,font);
	TextDrawLetterSize(tdtext,0.500000,2.000000);
	TextDrawColor(tdtext,0xffffffff);
	TextDrawSetOutline(tdtext,1);
	TextDrawSetProportional(tdtext,1);
	TextDrawSetShadow(tdtext,1);
	TextDrawHideForAll(tdtext);
	TextDrawShowForPlayer(playerid, tdtext);
	remtimer = SetTimer("GameTextRemoval",time*1000,false);
}

stock DisplayTextForAll(/*const*/text[], time, font, style) // Max Fonts: 3(0-3)   <->   Max Styles: 4(1-4)
{
	new Float:TEXTX,Float:TEXTY;
	if(tdtext != Text:-1)
	{
		GameTextRemoval();
		KillTimer(remtimer);
	}
	if (style == 1) TEXTX = 231, TEXTY = 142;
	else if (style == 2) TEXTX = 246, TEXTY = 142;
	else if (style == 3) TEXTX = 451, TEXTY = 378;
	else if (style == 4) TEXTX = 1, TEXTY = 376;
	else TEXTX = 246, TEXTY = 142;
	tdtext = TextDrawCreate(TEXTX,TEXTY,text);
	TextDrawAlignment(tdtext,0);
	TextDrawBackgroundColor(tdtext,0x000000ff);
	TextDrawFont(tdtext,font);
	TextDrawLetterSize(tdtext,0.500000,2.000000);
	TextDrawColor(tdtext,0xffffffff);
	TextDrawSetOutline(tdtext,1);
	TextDrawSetProportional(tdtext,1);
	TextDrawSetShadow(tdtext,1);
	TextDrawShowForAll(tdtext);
	remtimer = SetTimer("GameTextRemoval",time*1000,false);
}

public GameTextRemoval()
{
	if(tdtext != Text:-1)
	{
		TextDrawDestroy(tdtext);
		tdtext = Text:-1;
		return true;
	}
	return false;
}